<template>
  <div class="B_two">
    <div>
      <div>工作面找直</div>
      <div>
        <div>当前支架 - 2号</div>
        <div>支架状态 - <div style="color: #00B42A;margin-left: 4px;font-weight: 900;">正常</div>
        </div>
      </div>
      <div>
        <div>手动推溜</div>
        <div>自动推溜</div>
      </div>
    </div>

    <!-- 支架列表滚动区域 -->
    <div class="scroll-container">
      <div class="scroll-content">
        <div v-for="item in list" :key="item.id" class="stent-item">
          <div>
            <img class="status-img" :src="getStatusImage(item.state)" :alt="item.name">
          </div>

          <div class="stent-name">
            {{ item.name }}
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'StentList',
  data() {
    return {
      list: [
        { id: 2, name: '支架2', state: 1 },
        { id: 3, name: '支架3', state: 1 },
        { id: 4, name: '支架4', state: 0 },
        { id: 5, name: '支架5', state: 1 },
        { id: 6, name: '支架6', state: 1 },
        { id: 7, name: '支架7', state: 1 },
        { id: 8, name: '支架8', state: 1 },
        { id: 9, name: '支架9', state: 1 },
        { id: 10, name: '支架10', state: 1 },
        { id: 11, name: '支架11', state: 1 },
        { id: 12, name: '支架12', state: 1 },
        { id: 13, name: '支架13', state: 1 },
        { id: 14, name: '支架14', state: 1 },
        { id: 15, name: '支架15', state: 1 },
        { id: 16, name: '支架16', state: 1 },
        { id: 17, name: '支架17', state: 1 },
        { id: 18, name: '支架18', state: 1 },
        { id: 19, name: '支架19', state: 1 },
        { id: 20, name: '支架20', state: 1 },
        { id: 21, name: '支架21', state: 1 },
        { id: 22, name: '支架22', state: 1 },
      ]
    }
  },
  methods: {
    getStatusImage(status) {
      const images = {
        0: require('../../../../assets/Scraper/BJ.png'),
        2: require('../../../../assets/Scraper/ZC.png'),
      };
      return images[status] || require('../../../../assets/Scraper/ZC.png');
    },
  },
}
</script>

<style lang="less" scoped>
* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

.B_two {
  width: 100%;
  height: 100%;



  >div:nth-child(1) {
    width: 100%;
    height: 25%;
    display: flex;
    align-items: center;
    padding: 0 20px;

    >div:nth-child(1) {
      height: 100%;
      color: #63F5E1;
      font-size: 20px;
      font-weight: 900;
      display: flex;
      align-items: center;
    }

    >div:nth-child(2) {
      width: 40%;
      display: flex;
      align-items: center;
      margin-left: 40px;
      color: #FFFFFF;

      >div {
        margin: 0 10px;
      }

      >div:nth-child(2) {
        display: flex;
        align-items: center;
      }
    }

    >div:nth-child(3) {
      width: 40%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: flex-end;

      >div:nth-child(1) {
        width: 100px;
        height: 35px;
        border-radius: 10px;
        text-align: center;
        line-height: 35px;
        background-color: #597EF7;
        font-size: 14px;
        color: white;

      }

      >div:nth-child(2) {
        width: 100px;
        height: 35px;
        border: 1px solid rgba(255, 255, 255, 0.65);
        border-radius: 10px;
        text-align: center;
        line-height: 35px;
        color: white;
        font-size: 14px;
        margin-left: 20px;
      }
    }
  }

  .scroll-container {
    height: 75%;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 20px 0;
    position: relative;

    &::-webkit-scrollbar {
      height: 6px;
    }

    &::-webkit-scrollbar-track {
      background: rgba(255, 255, 255, 0.1);
      border-radius: 10px;
    }

    &::-webkit-scrollbar-thumb {
      background: rgba(255, 255, 255, 0.3);
      border-radius: 10px;
    }

    &::-webkit-scrollbar-thumb:hover {
      background: rgba(255, 255, 255, 0.5);
    }
  }

  .scroll-content {
    display: flex;
    gap: 15px;
    padding: 0 10px;
    height: 100%;
    align-items: center;
    scroll-behavior: smooth;
  }

  .stent-item {
    width: 50px;
    flex-shrink: 0;
    text-align: center;
    height: 80%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .status-img {
    width: 40px;
    height: 80px;
    object-fit: contain;
  }



  .stent-name {
    color: white;
    margin-top: 5px;
    font-size: 14px;
  }
}
</style>